Skip to content

Add engine-owned scene system with hierarchy, cameras, lights and renderables (Statement 11) - #11

Merged
ercmine merged 1 commit into
mainfrom
codex/build-scene-system-with-hierarchy-and-components
Apr 6, 2026
Merged

Add engine-owned scene system with hierarchy, cameras, lights and renderables (Statement 11)#11
ercmine merged 1 commit into
mainfrom
codex/build-scene-system-with-hierarchy-and-components

Conversation

@ercmine

@ercmine ercmine commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide the engine-owned spatial foundation (scene graph) that supports stable identity, parent-child hierarchy, local/world transforms, cameras, lights, renderables, visibility flags, and debug names.
  • Make the scene the canonical extraction layer for the renderer so future gameplay/tools can build on a stable runtime abstraction.

Description

  • Added a new scene module under engine/scene/ exposing Scene, SceneNodeId (index+generation), CameraComponent, LightComponent, RenderableComponent, visibility/layer masks, reparent policies, and debug name APIs (engine/scene/scene.hpp and engine/scene/scene.cpp).
  • Implemented stable handle validation and reuse-safety via index+generation, defensive lookup, and generation bump/free-list reuse on destroy.
  • Implemented parent/child operations with cycle prevention, explicit ReparentPolicy (KeepLocalTransform / KeepWorldTransform), subtree dirty propagation, and update_world_transforms() for top-down world transform computation.
  • Added renderer extraction helpers: build_camera_view(...), collect_visible_renderables(...), and collect_visible_lights(...), and integrated the scene into the shell so render_shell builds a small demo scene and submits visible renderables to the renderer without leaking backend types.
  • Added module docs (engine/scene/README.md, docs/scene.md) and updated docs/architecture.md and docs/rendering.md to mention the scene integration, and wired the scene into CMake with a render_scene library and render_scene_tests target.

Testing

  • Ran a local compile+unit run for the new scene unit test by compiling tests/scene/scene_tests.cpp and supporting core files with g++ and executing the binary, which succeeded (test assertions passed).
  • Built and ran core runtime unit test (tests/core/core_runtime_tests.cpp) via direct g++ invocation and the test succeeded.
  • Attempted full CMake configure/build with cmake --preset linux-debug, which failed in this environment due to missing external dependencies (SDL3/bgfx); this is an environment issue and does not affect the scene module unit tests executed above.

Codex Task

@ercmine
ercmine merged commit acb51b0 into main Apr 6, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant